<template>
  <div class="JNPF-common-layout">
    <div class="JNPF-preview-main">
      <!--      <div class="JNPF-common-page-header">
                      <p>中小企业数字化转型测评_制造业</p>
              <div class="options">
                <el-button type="primary" @click="dataFormSubmit()"> 保 存</el-button>
                <el-button @click="clearData">重置</el-button>
              </div>
            </div>-->
      <el-row :gutter="60" class=" main" :style="{ margin: '0 auto', width: '100%' }">
        <el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="100px" label-position="top">
          <template v-if="!loading">
            <!-- 具体表单 -->
            <el-col :span="4"></el-col>
            <el-col :span="16">
              <div class="tit_top">制造业中小企业数字化水平评测表（2022年版）</div>
              <div class="tit_sec">
                SELF ASSESSMENT QUESTIONNAIRE OF DIGITAL TRANSFORMATION LEVEL OF SMALL AND
                MEDIUM-SIZED ENTERPRISES
              </div>
              <div class="tit_thr">
                <div class="tit_red"></div>
                <div class="tit_gray"></div>
              </div>
              <div class="met_list">
                <div>总题数：26</div>
                <div>已选：{{ filledFieldsCount - 3 }}</div>
                <div>未选：{{ 29 - filledFieldsCount }}</div>
              </div>
              <div class="steps">
                <el-steps :active="active">
                  <el-step title="数字化基础"></el-step>
                  <el-step title="数字化经营"></el-step>
                  <el-step title="数字化管理"></el-step>
                  <el-step title="数字化成效"></el-step>
                </el-steps>
              </div>
              <div v-show="active == 1" class="steps_con">
                <el-col :span="24">
                  <jnpf-form-tip-item label="1. 企业的数字化设备覆盖范围" tipLabel="数字化设备是指重点聚焦生产环节的带通讯接口的机电一体化设备，如生产设备、物流设备、检验检测设备等。"
                    prop="questiontitle16">
                    <JnpfRadio v-model="dataForm.questiontitle16" @change="changeData('questiontitle16', -1)"
                      optionType="default" direction="vertical" size="small" :options="questiontitle16Options"
                      :props="questiontitle16Props">
                    </JnpfRadio>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="24">
                  <jnpf-form-tip-item label="2. 企业的数字化设备联网率" tipLabel="联网率=连接内外网的数字化设备数量/总设备数量。" prop="questiontitle15">
                    <JnpfRadio v-model="dataForm.questiontitle15" @change="changeData('questiontitle15', -1)"
                      optionType="default" direction="vertical" size="small" :options="questiontitle15Options"
                      :props="questiontitle15Props">
                    </JnpfRadio>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="24">
                  <jnpf-form-tip-item label="3. 企业的关键工序数控化率" prop="questiontitle14">
                    <JnpfRadio v-model="dataForm.questiontitle14" @change="changeData('questiontitle14', -1)"
                      optionType="default" direction="vertical" size="small" :options="questiontitle14Options"
                      :props="questiontitle14Props">
                    </JnpfRadio>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="24">
                  <jnpf-form-tip-item label="4. 企业通过部署工业互联网公有云/私有云/混合云平台等形式，实现业务的数字化管理情况" prop="questiontitle17">
                    <JnpfRadio v-model="dataForm.questiontitle17" @change="changeData('questiontitle17', -1)"
                      optionType="default" direction="vertical" size="small" :options="questiontitle17Options"
                      :props="questiontitle17Props">
                    </JnpfRadio>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="24">
                  <jnpf-form-tip-item label="5. 企业实现数据自动/半自动获取并展示的业务环节覆盖范围(多选)"
                    tipLabel="自动获取是指直接从业务系统中自动获得数据，数据从产生的源头抓取，数据不落地、不可更改。以研发为例，数据从研发环节的源头被抓取后，可以在业务系统中自动获取相关数据信息，能够快速读取、查询、调用，实现统一集中管理。"
                    prop="questiontitle12">
                    <JnpfCheckbox v-model="dataForm.questiontitle12" @change="changeData('questiontitle12', -1)"
                      optionType="default" direction="vertical" size="small" :options="questiontitle12Options"
                      :props="questiontitle12Props">
                    </JnpfCheckbox>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="24">
                  <jnpf-form-tip-item label="6. 企业实现各类数据汇聚及应用的情况(多选)" prop="questiontitle11">
                    <JnpfCheckbox v-model="dataForm.questiontitle11" @change="changeData('questiontitle11', -1)"
                      optionType="default" direction="vertical" size="small" :options="questiontitle11Options"
                      :props="questiontitle11Props">
                    </JnpfCheckbox>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="24">
                  <jnpf-form-tip-item label="7. 企业在保障网络安全方面采取的举措情况(多选)" prop="questiontitle8">
                    <JnpfRadio v-model="dataForm.questiontitle8" @change="changeData('questiontitle8', -1)"
                      optionType="default" direction="vertical" size="small" :options="questiontitle8Options"
                      :props="questiontitle8Props">
                    </JnpfRadio>
                  </jnpf-form-tip-item>
                </el-col>
              </div>
              <div v-show="active == 2" class="steps_con">
                <el-col :span="24">
                  <jnpf-form-tip-item label="8. 研发设计环节，企业开展数字化研发设计的情况(多选)" tipLabel="50%以上关键业务研发设计项目实现下列数字化场景即可勾选该项"
                    prop="questiontitle23">
                    <JnpfCheckbox v-model="dataForm.questiontitle23" @change="changeData('questiontitle23', -1)"
                      optionType="default" direction="vertical" size="small" :options="questiontitle23Options"
                      :props="questiontitle23Props">
                    </JnpfCheckbox>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="24">
                  <jnpf-form-tip-item label="9. 生产计划环节，企业实现生产计划排产排程的情况" prop="questiontitle22">
                    <JnpfRadio v-model="dataForm.questiontitle22" @change="changeData('questiontitle22', -1)"
                      optionType="default" direction="vertical" size="small" :options="questiontitle22Options"
                      :props="questiontitle22Props">
                    </JnpfRadio>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="24">
                  <jnpf-form-tip-item label="10. 生产监控环节，企业利用信息系统实现生产过程监控的情况(多选)"
                    tipLabel="利用信息系统实现生产过程监控：通过建立基于多个设备/工序/生产线/车间的生产过程实时/历史数据平台，实现其生产过程监督和管理的信息系统。"
                    prop="questiontitle21">
                    <JnpfCheckbox v-model="dataForm.questiontitle21" @change="changeData('questiontitle21', -1)"
                      optionType="default" direction="vertical" size="small" :options="questiontitle21Options"
                      :props="questiontitle21Props">
                    </JnpfCheckbox>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="24">
                  <jnpf-form-tip-item label="11. 生产作业环节，企业实现智能制造典型场景的覆盖范围(多选)" prop="questiontitle20">
                    <JnpfCheckbox v-model="dataForm.questiontitle20" @change="changeData('questiontitle20', -1)"
                      optionType="default" direction="vertical" size="small" :options="questiontitle20Options"
                      :props="questiontitle20Props">
                    </JnpfCheckbox>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="24">
                  <jnpf-form-tip-item label="12. 质量控制环节，企业运用数字化手段提高质量控制能力的重点场景覆盖范围(多选)" tipLabel="某一种或几种关键产品或物料实现即可勾选"
                    prop="questiontitle25">
                    <JnpfCheckbox v-model="dataForm.questiontitle25" @change="changeData('questiontitle25', -1)"
                      optionType="default" direction="vertical" size="small" :options="questiontitle25Options"
                      :props="questiontitle25Props">
                    </JnpfCheckbox>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="24">
                  <jnpf-form-tip-item label="13. 仓储物流环节：企业实现仓储物流数字化场景的覆盖范围(多选)"
                    tipLabel="注1：50%以上关键原料、半成品、成品等实现下列数字化场景即可勾选该项。注2：通过第三方、第四方物流实现的仓储物流数字化，如覆盖下述场景也可勾选"
                    prop="questiontitle3">
                    <JnpfCheckbox v-model="dataForm.questiontitle3" @change="changeData('questiontitle3', -1)"
                      optionType="default" direction="vertical" size="small" :options="questiontitle3Options"
                      :props="questiontitle3Props">
                    </JnpfCheckbox>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="24">
                  <jnpf-form-tip-item label="14. 采购供应环节：企业实现采购管理数字化场景的覆盖范围(多选)" tipLabel="50%以上关键业务采购活动实现下列数字化场景即可勾选该项"
                    prop="questiontitle26">
                    <JnpfCheckbox v-model="dataForm.questiontitle26" @change="changeData('questiontitle26', -1)"
                      optionType="default" direction="vertical" size="small" :options="questiontitle26Options"
                      :props="questiontitle26Props">
                    </JnpfCheckbox>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="24">
                  <jnpf-form-tip-item label="15. 营销管理环节，企业实现营销管理数字化场景的覆盖范围(多选)" tipLabel="50%以上关键业务市场营销实现下列数字化场景即可勾选该项"
                    prop="questiontitle24">
                    <JnpfCheckbox v-model="dataForm.questiontitle24" @change="changeData('questiontitle24', -1)"
                      optionType="default" direction="vertical" size="small" :options="questiontitle24Options"
                      :props="questiontitle24Props">
                    </JnpfCheckbox>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="24">
                  <jnpf-form-tip-item label="16. 产品服务环节，企业实现产品服务数字化场景的覆盖范围(多选)"
                    tipLabel="利用信息系统实现售后服务数字化管理的情况（50%以上关键产品售后服务实现下列数字化场景即可勾选该项" prop="questiontitle2">
                    <JnpfCheckbox v-model="dataForm.questiontitle2" @change="changeData('questiontitle2', -1)"
                      optionType="default" direction="vertical" size="small" :options="questiontitle2Options"
                      :props="questiontitle2Props">
                    </JnpfCheckbox>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="24">
                  <jnpf-form-tip-item label="17. 利用数字化技术实现售后服务与相关业务的协同情况(多选)" tipLabel="50%以上关键产品售后服务实现下列数字化场景即可勾选该项"
                    prop="questiontitle18">
                    <JnpfCheckbox v-model="dataForm.questiontitle18" @change="changeData('questiontitle18', -1)"
                      optionType="default" direction="vertical" size="small" :options="questiontitle18Options"
                      :props="questiontitle18Props">
                    </JnpfCheckbox>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="24">
                  <jnpf-form-tip-item label="18. 新一代信息技术在新型智能产品中应用场景的覆盖范围(多选)" tipLabel="某一种或几种关键产品实现下列数字化场景即可勾选该项"
                    prop="questiontitle19">
                    <JnpfCheckbox v-model="dataForm.questiontitle19" @change="changeData('questiontitle19', -1)"
                      optionType="default" direction="vertical" size="small" :options="questiontitle19Options"
                      :props="questiontitle19Props">
                    </JnpfCheckbox>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="24">
                  <jnpf-form-tip-item label="19. 业务协同方面，企业使用数字化技术实现企业间业务协同数字化场景的覆盖范围(多选)"
                    tipLabel="50%以上关键业务客户、上游供应企业或合作伙伴使用数字化技术实现下列数字化场景即可勾选该项" prop="questiontitle1">
                    <JnpfCheckbox v-model="dataForm.questiontitle1" @change="changeData('questiontitle1', -1)"
                      optionType="default" direction="vertical" size="small" :options="questiontitle1Options"
                      :props="questiontitle1Props">
                    </JnpfCheckbox>
                  </jnpf-form-tip-item>
                </el-col>
              </div>
              <div v-show="active == 3" class="steps_con">
                <el-col :span="24">
                  <jnpf-form-tip-item label="20. 企业数字化转型意识与执行水平情况(多选)" prop="questiontitle13">
                    <JnpfCheckbox v-model="dataForm.questiontitle13" @change="changeData('questiontitle13', -1)"
                      optionType="default" direction="vertical" size="small" :options="questiontitle13Options"
                      :props="questiontitle13Props">
                    </JnpfCheckbox>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="24">
                  <jnpf-form-tip-item label="21. 企业在设置数字化组织与管理制度等方面采取的措施(多选)" prop="questiontitle10">
                    <JnpfCheckbox v-model="dataForm.questiontitle10" @change="changeData('questiontitle10', -1)"
                      optionType="default" direction="vertical" size="small" :options="questiontitle10Options"
                      :props="questiontitle10Props">
                    </JnpfCheckbox>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="24">
                  <jnpf-form-tip-item label="22.企业在数字化方面培训覆盖的人员范围(多选)" prop="questiontitle9">
                    <JnpfCheckbox v-model="dataForm.questiontitle9" @change="changeData('questiontitle9', -1)"
                      optionType="default" direction="vertical" size="small" :options="questiontitle9Options"
                      :props="questiontitle9Props">
                    </JnpfCheckbox>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="24">
                  <jnpf-form-tip-item label="23. 企业上年度数字化投入占营业收入的比重" prop="questiontitle6">
                    <JnpfRadio v-model="dataForm.questiontitle6" @change="changeData('questiontitle6', -1)"
                      optionType="default" direction="vertical" size="small" :options="questiontitle6Options"
                      :props="questiontitle6Props">
                    </JnpfRadio>
                  </jnpf-form-tip-item>
                </el-col>
              </div>
              <div v-show="active == 4" class="steps_con">
                <el-col :span="24">
                  <jnpf-form-tip-item label="24. 企业上年度产品合格率" prop="questiontitle4">
                    <JnpfRadio v-model="dataForm.questiontitle4" @change="changeData('questiontitle4', -1)"
                      optionType="default" direction="vertical" size="small" :options="questiontitle4Options"
                      :props="questiontitle4Props">
                    </JnpfRadio>
                  </jnpf-form-tip-item>
                  <jnpf-form-tip-item label-width="0" prop="question4value">
                    <JnpfInputNumber v-model="dataForm.question4value" @change="changeData('question4value', -1)"
                      placeholder="请输入具体数值" :step="1" :controls="false" addonAfter="%" style="width: 300px;">
                    </JnpfInputNumber>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="24">
                  <jnpf-form-tip-item label="25. 企业上年度人均营业收入" prop="questiontitle5">
                    <JnpfRadio v-model="dataForm.questiontitle5" @change="changeData('questiontitle5', -1)"
                      optionType="default" direction="vertical" size="small" :options="questiontitle5Options"
                      :props="questiontitle5Props">
                    </JnpfRadio>
                  </jnpf-form-tip-item>
                  <jnpf-form-tip-item label-width="0" prop="question5value">
                    <JnpfInputNumber v-model="dataForm.question5value" @change="changeData('question5value', -1)"
                      placeholder="请输入具体数值" :step="1" :controls="false" addonAfter="元" style="width: 300px;">
                    </JnpfInputNumber>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="24">
                  <jnpf-form-tip-item label="26. 企业上年度每百元营业收入中的成本" prop="questiontitle7">
                    <JnpfRadio v-model="dataForm.questiontitle7" @change="changeData('questiontitle7', -1)"
                      optionType="default" direction="vertical" size="small" :options="questiontitle7Options"
                      :props="questiontitle7Props">
                    </JnpfRadio>
                  </jnpf-form-tip-item>
                  <jnpf-form-tip-item label-width="0" prop="question7value">
                    <JnpfInputNumber v-model="dataForm.question7value" @change="changeData('question7value', -1)"
                      placeholder="请输入具体数值" :step="1" :controls="false" addonAfter="元" style="width: 300px;">
                    </JnpfInputNumber>
                  </jnpf-form-tip-item>
                </el-col>
              </div>
              <div class="footer-button">
                <el-button @click="prev" :disabled="active == 1">上一步</el-button>
                <el-button @click="next" v-if="active < 4" type="primary" :loading="btnLoading" :disabled="active == 4">
                  下一步
                </el-button>
                <el-button type="primary" @click="dataFormSubmit()" v-if="active == 4"> 保存并提交</el-button>
              </div>
            </el-col>
            <el-col :span="4"></el-col>
            <!-- 表单结束 -->
          </template>
        </el-form>
        <SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm" ref="selectDialog"
          @select="addForSelect" @close="selectDialogVisible = false" />
      </el-row>
    </div>
  </div>
</template>


<script>
import request from '@/utils/request'
import request2 from '@/utils/request2'
import { mapGetters } from "vuex";
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
import { getDefaultCurrentValueUserId } from '@/api/permission/user'
import { getDefaultCurrentValueDepartmentId } from '@/api/permission/organize'
import {
  getDateDay,
  getLaterData,
  getBeforeData,
  getBeforeTime,
  getLaterTime
} from '@/components/Generator/utils/index.js'
import { thousandsFormat } from "@/components/Generator/utils/index"

export default {
  components: {},
  props: [],
  data() {
    return {
      filledFieldsCount: 3,
      active: 1,
      dataFormSubmitType: 0,
      continueBtnLoading: false,
      index: 0,
      prevDis: false,
      nextDis: false,
      allList: [],
      visible: false,
      loading: false,
      btnLoading: false,
      formRef: 'formRef',
      setting: {},
      eventType: '',
      userBoxVisible: false,
      selectDialogVisible: false,
      currTableConf: {},
      dataValueAll: {},
      addTableConf: {},
      //可选范围默认值
      ableAll: {},
      tableRows: {},
      Vmodel: "",
      currVmodel: "",
      dataForm: {
        questiontitle16: undefined,
        questiontitle15: undefined,
        questiontitle14: undefined,
        questiontitle17: undefined,
        questiontitle12: [],
        questiontitle11: [],
        questiontitle8: undefined,
        questiontitle23: [],
        questiontitle22: undefined,
        questiontitle21: [],
        questiontitle20: [],
        questiontitle25: [],
        questiontitle3: [],
        questiontitle26: [],
        questiontitle24: [],
        questiontitle2: [],
        questiontitle18: [],
        questiontitle19: [],
        questiontitle1: [],
        questiontitle13: [],
        questiontitle10: [],
        questiontitle9: [],
        questiontitle6: undefined,
        questiontitle4: undefined,
        questiontitle5: undefined,
        questiontitle7: undefined,
        question4value: undefined,
        question5value: undefined,
        question7value: undefined,
        F_Company_Name: this.$route.query.companyName,
        F_Creedit_Code: this.$route.query.creeditCode,
        F_Company_Id: this.$route.query.companyId
      },
      tableRequiredData: {},
      activeontldg: 'VPdq6u1',
      dataRule:
      {
        questiontitle16: [
          {
            required: true,
            message: '不能为空',
            trigger: 'change'
          },
        ],
        questiontitle15: [
          {
            required: true,
            message: '不能为空',
            trigger: 'change'
          },
        ],
        questiontitle14: [
          {
            required: true,
            message: '不能为空',
            trigger: 'change'
          },
        ],
        questiontitle17: [
          {
            required: true,
            message: '不能为空',
            trigger: 'change'
          },
        ],
        questiontitle11: [
          {
            required: true,
            message: '请至少选择一个',
            trigger: 'change'
          },
        ],
        questiontitle8: [
          {
            required: true,
            message: '不能为空',
            trigger: 'change'
          },
        ],
        questiontitle23: [
          {
            required: true,
            message: '请至少选择一个',
            trigger: 'change'
          },
        ],
        questiontitle22: [
          {
            required: true,
            message: '不能为空',
            trigger: 'change'
          },
        ],
        questiontitle21: [
          {
            required: true,
            message: '请至少选择一个',
            trigger: 'change'
          },
        ],
        questiontitle20: [
          {
            required: true,
            message: '请至少选择一个',
            trigger: 'change'
          },
        ],
        questiontitle25: [
          {
            required: true,
            message: '请至少选择一个',
            trigger: 'change'
          },
        ],
        questiontitle3: [
          {
            required: true,
            message: '请至少选择一个',
            trigger: 'change'
          },
        ],
        questiontitle26: [
          {
            required: true,
            message: '请至少选择一个',
            trigger: 'change'
          },
        ],
        questiontitle24: [
          {
            required: true,
            message: '请至少选择一个',
            trigger: 'change'
          },
        ],
        questiontitle2: [
          {
            required: true,
            message: '请至少选择一个',
            trigger: 'change'
          },
        ],
        questiontitle18: [
          {
            required: true,
            message: '请至少选择一个',
            trigger: 'change'
          },
        ],
        questiontitle19: [
          {
            required: true,
            message: '请至少选择一个',
            trigger: 'change'
          },
        ],
        questiontitle1: [
          {
            required: true,
            message: '请至少选择一个',
            trigger: 'change'
          },
        ],
        questiontitle13: [
          {
            required: true,
            message: '请至少选择一个',
            trigger: 'change'
          },
        ],
        questiontitle10: [
          {
            required: true,
            message: '请至少选择一个',
            trigger: 'change'
          },
        ],
        questiontitle9: [
          {
            required: true,
            message: '请至少选择一个',
            trigger: 'change'
          },
        ],
        questiontitle6: [
          {
            required: true,
            message: '不能为空',
            trigger: 'change'
          },
        ],
        questiontitle4: [
          {
            required: true,
            message: '不能为空',
            trigger: 'change'
          },
        ],
        questiontitle5: [
          {
            required: true,
            message: '不能为空',
            trigger: 'change'
          },
        ],
        questiontitle7: [
          {
            required: true,
            message: '不能为空',
            trigger: 'change'
          },
        ],
        questiontitle12: [
          {
            required: true,
            message: '请至少选择一个',
            trigger: 'change'
          },
        ],
      },
      questiontitle16Options: [],
      questiontitle16Props: { "label": "fullName", "value": "fullName" },
      questiontitle15Options: [],
      questiontitle15Props: { "label": "fullName", "value": "fullName" },
      questiontitle14Options: [],
      questiontitle14Props: { "label": "fullName", "value": "fullName" },
      questiontitle17Options: [],
      questiontitle17Props: { "label": "fullName", "value": "fullName" },
      questiontitle12Options: [],
      questiontitle12Props: { "label": "fullName", "value": "fullName" },
      questiontitle11Options: [],
      questiontitle11Props: { "label": "fullName", "value": "fullName" },
      questiontitle8Options: [],
      questiontitle8Props: { "label": "fullName", "value": "fullName" },
      questiontitle23Options: [],
      questiontitle23Props: { "label": "fullName", "value": "fullName" },
      questiontitle22Options: [],
      questiontitle22Props: { "label": "fullName", "value": "fullName" },
      questiontitle21Options: [],
      questiontitle21Props: { "label": "fullName", "value": "fullName" },
      questiontitle20Options: [],
      questiontitle20Props: { "label": "fullName", "value": "fullName" },
      questiontitle25Options: [],
      questiontitle25Props: { "label": "fullName", "value": "fullName" },
      questiontitle3Options: [],
      questiontitle3Props: { "label": "fullName", "value": "fullName" },
      questiontitle26Options: [],
      questiontitle26Props: { "label": "fullName", "value": "fullName" },
      questiontitle24Options: [],
      questiontitle24Props: { "label": "fullName", "value": "fullName" },
      questiontitle2Options: [],
      questiontitle2Props: { "label": "fullName", "value": "fullName" },
      questiontitle18Options: [],
      questiontitle18Props: { "label": "fullName", "value": "fullName" },
      questiontitle19Options: [],
      questiontitle19Props: { "label": "fullName", "value": "fullName" },
      questiontitle1Options: [],
      questiontitle1Props: { "label": "fullName", "value": "fullName" },
      questiontitle13Options: [],
      questiontitle13Props: { "label": "fullName", "value": "fullName" },
      questiontitle10Options: [],
      questiontitle10Props: { "label": "fullName", "value": "fullName" },
      questiontitle9Options: [],
      questiontitle9Props: { "label": "fullName", "value": "fullName" },
      questiontitle6Options: [],
      questiontitle6Props: { "label": "fullName", "value": "fullName" },
      questiontitle4Options: [],
      questiontitle4Props: { "label": "fullName", "value": "fullName" },
      questiontitle5Options: [],
      questiontitle5Props: { "label": "fullName", "value": "fullName" },
      questiontitle7Options: [],
      questiontitle7Props: { "label": "fullName", "value": "fullName" },
      childIndex: -1,
      isEdit: false,
      interfaceRes: {
        questiontitle16: [],
        questiontitle15: [],
        questiontitle14: [],
        questiontitle17: [],
        questiontitle12: [],
        questiontitle11: [],
        questiontitle8: [],
        questiontitle23: [],
        questiontitle22: [],
        questiontitle21: [],
        questiontitle20: [],
        questiontitle25: [],
        questiontitle3: [],
        questiontitle26: [],
        questiontitle24: [],
        questiontitle2: [],
        questiontitle18: [],
        questiontitle19: [],
        questiontitle1: [],
        questiontitle13: [],
        questiontitle10: [],
        questiontitle9: [],
        questiontitle6: [],
        questiontitle4: [],
        question4value: [],
        questiontitle5: [],
        question5value: [],
        questiontitle7: [],
        question7value: [],
      },
    }
  },
  computed: {
    ...mapGetters(['userInfo'])
  },
  watch: {
    dataForm: {
      handler(newVal, oldVal) {
        // 遍历dataForm对象的属性
        this.filledFieldsCount = Object.keys(newVal).reduce((count, key) => {
          // 检查字段是否有值，排除空数组
          if (newVal[key] !== null && newVal[key] !== undefined && typeof newVal[key] !== 'number') {
            // 如果字段值是数组，检查其长度；如果长度为0，则不增加计数
            if (Array.isArray(newVal[key]) && newVal[key].length === 0) {
              return count;
            }
            // 如果字段值不是数组，或者数组长度大于0，则增加计数
            return count + 1;
          }
          return count;
        }, 0);
      },
      deep: true  // 深度监听对象的变化
    }
  },
  created() {
    this.dataAll()
    this.initDefaultData()
    this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
  },
  mounted() {
  },
  methods: {
    prev() {
      this.active--
      const formElement = this.$refs.formRef;
      // 滚动到表单元素的顶部
      formElement.$el.scrollIntoView({ behavior: 'smooth', block: 'center' });
    },
    next() {
      this.active++
      const formElement = this.$refs.formRef;
      // 滚动到表单元素的顶部
      formElement.$el.scrollIntoView({ behavior: 'smooth', block: 'center' });
    },
    getInfo(id) {
      request({
        url: '/api/example/Fz_digital_transformation_evaluation/' + id,
        method: 'get'
      }).then(res => {
        this.dataInfo(res.data)
      });
    },
    changeData(model, index) {
      this.isEdit = false
      this.childIndex = index
      let modelAll = model.split("-");
      let faceMode = "";
      for (let i = 0; i < modelAll.length; i++) {
        faceMode += modelAll[i];
      }
      for (let key in this.interfaceRes) {
        if (key != faceMode) {
          let faceReList = this.interfaceRes[key]
          for (let i = 0; i < faceReList.length; i++) {
            if (faceReList[i].relationField == model) {
              let options = 'get' + key + 'Options';
              if (this[options]) {
                this[options]()
              }
              this.changeData(key, index)
            }
          }
        }
      }
    },
    changeDataFormData(type, data, model, index, defaultValue) {
      if (!this.isEdit) {
        if (type == 2) {
          for (let i = 0; i < this.dataForm[data].length; i++) {
            if (index == -1) {
              this.dataForm[data][i][model] = defaultValue
            } else if (index == i) {
              this.dataForm[data][i][model] = defaultValue
            }
          }
        } else {
          this.dataForm[data] = defaultValue
        }
      }
    },
    dataAll() {
      this.getquestiontitle16Options();
      this.getquestiontitle15Options();
      this.getquestiontitle14Options();
      this.getquestiontitle17Options();
      this.getquestiontitle12Options();
      this.getquestiontitle11Options();
      this.getquestiontitle8Options();
      this.getquestiontitle23Options();
      this.getquestiontitle22Options();
      this.getquestiontitle21Options();
      this.getquestiontitle20Options();
      this.getquestiontitle25Options();
      this.getquestiontitle3Options();
      this.getquestiontitle26Options();
      this.getquestiontitle24Options();
      this.getquestiontitle2Options();
      this.getquestiontitle18Options();
      this.getquestiontitle19Options();
      this.getquestiontitle1Options();
      this.getquestiontitle13Options();
      this.getquestiontitle10Options();
      this.getquestiontitle9Options();
      this.getquestiontitle6Options();
      this.getquestiontitle4Options();
      this.getquestiontitle5Options();
      this.getquestiontitle7Options();
    },
    getquestiontitle16Options() {
      getDictionaryDataSelector('512965526805282885').then(res => {
        this.questiontitle16Options = res.data.list
      })
    },
    getquestiontitle15Options() {
      getDictionaryDataSelector('512965610959798341').then(res => {
        this.questiontitle15Options = res.data.list
      })
    },
    getquestiontitle14Options() {
      getDictionaryDataSelector('512965682292326469').then(res => {
        this.questiontitle14Options = res.data.list
      })
    },
    getquestiontitle17Options() {
      getDictionaryDataSelector('512965971518947397').then(res => {
        this.questiontitle17Options = res.data.list
      })
    },
    getquestiontitle12Options() {
      getDictionaryDataSelector('512966071343382597').then(res => {
        this.questiontitle12Options = res.data.list
      })
    },
    getquestiontitle11Options() {
      getDictionaryDataSelector('512966300176220229').then(res => {
        this.questiontitle11Options = res.data.list
      })
    },
    getquestiontitle8Options() {
      getDictionaryDataSelector('512966364604923973').then(res => {
        this.questiontitle8Options = res.data.list
      })
    },
    getquestiontitle23Options() {
      getDictionaryDataSelector('512966527520079941').then(res => {
        this.questiontitle23Options = res.data.list
      })
    },
    getquestiontitle22Options() {
      getDictionaryDataSelector('512966648815157317').then(res => {
        this.questiontitle22Options = res.data.list
      })
    },
    getquestiontitle21Options() {
      getDictionaryDataSelector('512966750103404613').then(res => {
        this.questiontitle21Options = res.data.list
      })
    },
    getquestiontitle20Options() {
      getDictionaryDataSelector('512966850536013893').then(res => {
        this.questiontitle20Options = res.data.list
      })
    },
    getquestiontitle25Options() {
      getDictionaryDataSelector('512966946585575493').then(res => {
        this.questiontitle25Options = res.data.list
      })
    },
    getquestiontitle3Options() {
      getDictionaryDataSelector('512967039350997061').then(res => {
        this.questiontitle3Options = res.data.list
      })
    },
    getquestiontitle26Options() {
      getDictionaryDataSelector('512967112893923397').then(res => {
        this.questiontitle26Options = res.data.list
      })
    },
    getquestiontitle24Options() {
      getDictionaryDataSelector('512967199841845317').then(res => {
        this.questiontitle24Options = res.data.list
      })
    },
    getquestiontitle2Options() {
      getDictionaryDataSelector('512967350123757637').then(res => {
        this.questiontitle2Options = res.data.list
      })
    },
    getquestiontitle18Options() {
      getDictionaryDataSelector('512967417975013445').then(res => {
        this.questiontitle18Options = res.data.list
      })
    },
    getquestiontitle19Options() {
      getDictionaryDataSelector('512967498514038853').then(res => {
        this.questiontitle19Options = res.data.list
      })
    },
    getquestiontitle1Options() {
      getDictionaryDataSelector('512967571855638597').then(res => {
        this.questiontitle1Options = res.data.list
      })
    },
    getquestiontitle13Options() {
      getDictionaryDataSelector('512967698997575749').then(res => {
        this.questiontitle13Options = res.data.list
      })
    },
    getquestiontitle10Options() {
      getDictionaryDataSelector('512967760704176197').then(res => {
        this.questiontitle10Options = res.data.list
      })
    },
    getquestiontitle9Options() {
      getDictionaryDataSelector('512967831445307461').then(res => {
        this.questiontitle9Options = res.data.list
      })
    },
    getquestiontitle6Options() {
      getDictionaryDataSelector('512967892430487621').then(res => {
        this.questiontitle6Options = res.data.list
      })
    },
    getquestiontitle4Options() {
      getDictionaryDataSelector('512968025142460485').then(res => {
        this.questiontitle4Options = res.data.list
      })
    },
    getquestiontitle5Options() {
      getDictionaryDataSelector('512968123071070277').then(res => {
        this.questiontitle5Options = res.data.list
      })
    },
    getquestiontitle7Options() {
      getDictionaryDataSelector('512968276297384005').then(res => {
        this.questiontitle7Options = res.data.list
      })
    },
    goBack() {
      this.$emit('refresh')
    },
    clearData() {
      this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
    },
    init(id, isDetail, allList) {
      this.prevDis = false
      this.nextDis = false
      this.allList = allList || []
      if (allList.length) {
        this.index = this.allList.findIndex(item => item.id === id)
        if (this.index == 0) {
          this.prevDis = true
        }
        if (this.index == this.allList.length - 1) {
          this.nextDis = true
        }
      } else {
        this.prevDis = true
        this.nextDis = true
      }
      this.dataForm.id = id || 0;
      this.visible = true;
      this.$nextTick(() => {
        if (this.dataForm.id) {
          this.loading = true
          request({
            url: '/api/example/Fz_digital_transformation_evaluation/' + this.dataForm.id,
            method: 'get'
          }).then(res => {
            this.dataInfo(res.data)
            this.loading = false
          });
        } else {
          this.clearData()
          this.initDefaultData()
        }
      });
      this.$store.commit('generator/UPDATE_RELATION_DATA', {})
    },
    //初始化默认数据
    initDefaultData() {

    },
    // 表单提交
    dataFormSubmit(type) {
      this.dataFormSubmitType = type ? type : 0
      this.$refs['formRef'].validate((valid) => {
        if (valid) {
          this.request()
        }
      })
    },
    request2(F_Id) {
      let _data = this.dataList()
      _data.F_Id = F_Id
      request2({
        url: '/fzzxqy/outEvaluate',
        method: 'post',
        data: _data
      }).then((res) => {
        this.$message({
          message: res.msg,
          type: 'success',
          duration: 1000,
          onClose: () => {
            this.clearData()
            this.initDefaultData()
            // 在当前组件中进行页面跳转并传递参数
            this.$router.push({
              path: '/outDigitalLevel',
              query: {
                companyName: this.$route.query.companyName,
                creeditCode: this.$route.query.creeditCode
              }
            });
          }
        })
      }).catch(() => {
        this.btnLoading = false
        this.continueBtnLoading = false
      })
    },
    request() {
      let _data = this.dataList()
      if (this.dataFormSubmitType == 2) {
        this.continueBtnLoading = true
      } else {
        this.btnLoading = true
      }
      if (!this.dataForm.id) {
        request({
          url: '/api/example/Fz_digital_transformation_evaluation_making',
          method: 'post',
          data: _data
        }).then((res) => {
          this.request2(res.data.id)
          // this.$message({
          //     message: res.msg,
          //     type: 'success',
          //     duration: 1000,
          //     onClose: () => {
          //         this.clearData()
          //         this.initDefaultData()
          //     }
          // })
        }).catch(() => {
          this.btnLoading = false
          this.continueBtnLoading = false
        })
      } else {
        request({
          url: '/api/example/Fz_digital_transformation_evaluation/' + this.dataForm.id,
          method: 'PUT',
          data: _data
        }).then((res) => {
          this.$message({
            message: res.msg,
            type: 'success',
            duration: 1000,
            onClose: () => {
              if (this.dataFormSubmitType == 2) return this.continueBtnLoading = false
              this.visible = false
              this.btnLoading = false
              this.$emit('refresh', true)
            }
          })
        }).catch(() => {
          this.btnLoading = false
          this.continueBtnLoading = false
        })
      }
    },
    openSelectDialog(key) {
      this.currTableConf = this.addTableConf[key]
      this.currVmodel = key
      this.selectDialogVisible = true
      this.$nextTick(() => {
        this.$refs.selectDialog.init()
      })
    },
    addForSelect(data) {
      for (let i = 0; i < data.length; i++) {
        let t = data[i]
        if (this['get' + this.currVmodel]) {
          this['get' + this.currVmodel](t)
        }
      }
    },
    dateTime(timeRule, timeType, timeTarget, timeValueData, dataValue) {
      let timeDataValue = null;
      let timeValue = Number(timeValueData)
      if (timeRule) {
        if (timeType == 1) {
          timeDataValue = timeValue
        } else if (timeType == 2) {
          timeDataValue = dataValue
        } else if (timeType == 3) {
          timeDataValue = new Date().getTime()
        } else if (timeType == 4) {
          let previousDate = '';
          if (timeTarget == 1 || timeTarget == 2) {
            previousDate = getDateDay(timeTarget, timeType, timeValue)
            timeDataValue = new Date(previousDate).getTime()
          } else if (timeTarget == 3) {
            previousDate = getBeforeData(timeValue)
            timeDataValue = new Date(previousDate).getTime()
          } else {
            timeDataValue = getBeforeTime(timeTarget, timeValue).getTime()
          }
        } else if (timeType == 5) {
          let previousDate = '';
          if (timeTarget == 1 || timeTarget == 2) {
            previousDate = getDateDay(timeTarget, timeType, timeValue)
            timeDataValue = new Date(previousDate).getTime()
          } else if (timeTarget == 3) {
            previousDate = getLaterData(timeValue)
            timeDataValue = new Date(previousDate).getTime()
          } else {
            timeDataValue = getLaterTime(timeTarget, timeValue).getTime()
          }
        }
      }
      return timeDataValue;
    },
    time(timeRule, timeType, timeTarget, timeValue, formatType, dataValue) {
      let format = formatType == 'HH:mm' ? 'HH:mm:00' : formatType
      let timeDataValue = null
      if (timeRule) {
        if (timeType == 1) {
          timeDataValue = timeValue || '00:00:00'
          if (timeDataValue.split(':').length == 3) {
            timeDataValue = timeDataValue
          } else {
            timeDataValue = timeDataValue + ':00'
          }
        } else if (timeType == 2) {
          timeDataValue = dataValue
        } else if (timeType == 3) {
          timeDataValue = this.jnpf.toDate(new Date(), format)
        } else if (timeType == 4) {
          let previousDate = '';
          previousDate = getBeforeTime(timeTarget, timeValue)
          timeDataValue = this.jnpf.toDate(previousDate, format)
        } else if (timeType == 5) {
          let previousDate = '';
          previousDate = getLaterTime(timeTarget, timeValue)
          timeDataValue = this.jnpf.toDate(previousDate, format)
        }
      }
      return timeDataValue;
    },
    dataList() {
      var _data = this.dataForm;
      return _data;
    },
    dataInfo(dataAll) {
      let _dataAll = dataAll
      this.dataForm = _dataAll
      this.isEdit = true
      this.dataAll()
      this.childIndex = -1
    },
  },
}

</script>
<style lang="scss" scoped>
.el-col {
  padding: 10px 20px;
}

.main {
  .tit_top {
    font-size: 32px;
    font-weight: 700;
    text-align: center;
    color: #333;
    margin-top: 20px;
  }

  .tit_sec {
    font-weight: 400;
    text-align: center;
    font-size: 12px;
    color: #ccc;
    margin-top: 6px;
    margin-bottom: 15px;
  }

  .tit_thr {
    width: 200px;
    height: 2px;
    margin: 10px auto;
    display: flex;

    .tit_red {
      width: 100px;
      height: 3px;
      background-color: #1890FF;
    }

    .tit_gray {
      width: 100px;
      height: 3px;
      background-color: #1890FF;
    }
  }

  .met_list {
    display: flex;
    margin: 20px auto;
    text-align: center;

    div {
      margin: auto;
      width: 100px;
    }
  }

  .steps {
    padding: 10px 80px;

    ::v-deep .el-step__main .is-finish {
      font-weight: bold;
    }
  }

  .steps_con {
    .el-col {
      border-bottom: 1px dotted grey;
    }
  }

  .footer-button {
    margin: auto;
    text-align: center;
    width: 100%;

    .el-button {
      margin: 20px;
      width: 150px;
    }
  }
}
</style>
